-- ----------------------------
-- Table structure for DynamicReport
-- ----------------------------
DROP TABLE IF EXISTS "public"."DynamicReport";
CREATE TABLE "public"."DynamicReport" (
  "DynamicReportId" int4 NOT NULL DEFAULT nextval('"DynamicReport_DynamicReportId_seq"'::regclass),
  "Name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "Data" text COLLATE "pg_catalog"."default" NOT NULL,
  "CreatedBy" int4 NOT NULL,
  "CreatedDate" timestamptz(6) NOT NULL,
  "ModifiedBy" int4,
  "ModifiedDate" timestamptz(6),
  "Active" bool NOT NULL DEFAULT true
)
;

-- ----------------------------
-- Primary Key structure for table DynamicReport
-- ----------------------------
ALTER TABLE "public"."DynamicReport" ADD CONSTRAINT "DynamicReport_pkey" PRIMARY KEY ("DynamicReportId");

-- ----------------------------
-- Foreign Keys structure for table DynamicReport
-- ----------------------------
ALTER TABLE "public"."DynamicReport" ADD CONSTRAINT "FK_DynamicReport_CreatedBy" FOREIGN KEY ("CreatedBy") REFERENCES "public"."Account" ("AccountId") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "public"."DynamicReport" ADD CONSTRAINT "FK_DynamicReport_ModifiedBy" FOREIGN KEY ("ModifiedBy") REFERENCES "public"."Account" ("AccountId") ON DELETE CASCADE ON UPDATE NO ACTION;
